<script setup lang="ts">
import { ref } from 'vue'
const username = ref('')
const password = ref('')
const isCheaked = ref(false)
const login = () => {
  if (isCheaked.value) {
    console.log(username.value, password.value)
  } else {
    alert('请同意')
  }
}
const reset = () => {
  username.value = ''
  password.value = ''
}
</script>

<template>
  <input v-model="username" type="text" placeholder="请输入用户名" />
  <input v-model="password" type="password" placeholder="请输入用户名" />
  <input v-model="isCheaked" type="checkbox" name="" id="" />
  <button @click="login">登录</button>
  <button @click="reset">重置</button>
</template>

<style></style>
